<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <style>
        @keyframes spin{
            0%{
                transform: rotateX(0) rotateY(0);
            }
            100%{
                transform:rotateX(360deg) rotateY(360deg);
            }
        }
        html{
            height: 100%;
        }
        body{
            margin: 0;
            height: 100%;
            /* 渐变背景色 */
            background: radial-gradient(white,black);
            display: flex;
            justify-content: center;
            align-items: center;
            /* 设置3D视角距离 */
            perspective: 1000px;
        }
        #box{
            width: 300px;
            height: 300px;
            /* border: solid 4px red; */
            position: relative;
            /* 自身发生变形时，保留子元素的3D表现效果 */
            transform-style: preserve-3d;
            animation-name: spin;
            animation-duration: 10s;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
        }
        .pic{
            width: 300px;
            height: 300px;
            position: absolute;
            left: 0;
            top: 0;
            transition: all 6s;
        }
         #front{
            transform: translateZ(150px);
        }
        #box:hover #front{
            transform: translateZ(240px);
        }
        #back{
            transform: translateZ(-150px);
        }
        #box:hover #back{
            transform: translateZ(-240px);
        }
        #top{
            transform: translateY(-150px) rotateX(90deg);
        }
        #box:hover #top{
            transform: translateY(-240px) rotateZ(270deg);
        }
        #bottom{
            transform:  translateY(150px)  rotateX(90deg);
        }
        #box:hover #bottom{
            transform:  translateY(240px)  rotateY(270deg);
        }
        #left{
            transform: translateX(-150px) rotateY(90deg);
        }
        #box:hover #left{
            transform: translateX(-240px) rotateX(270deg);
        }
        #right{
            transform: translateX(150px) rotateY(90deg);
        }
        #box:hover #right{
            transform: translateX(240px) rotateZ(270deg);
        }
    </style>
</head>
<body>
    <div id="box">
        <img src="f.jpg"  class="pic" id="front">
        <img src="b.jpg"  class="pic" id="back">
        <img src="a.jpg"  class="pic" id="top">
        <img src="d.jpg"  class="pic" id="bottom">
        <img src="e.jpg"  class="pic" id="left">
        <img src="c.jpg"  class="pic" id="right">
        <audio src="aaa.mp3"></audio>
    </div>    
</body>
</html>
